@extends('backend::layout')

@section('title', '新增课程')

@section('content')
    <form method="post">
        {{ csrf_field() }}
        <div class="box box-primary">
            <div class="box-header with-border">
                <div class="col-lg-4">
                    <h3 class="box-title">为 {{ $class->name }} 添加班主任</h3>
                </div>
            </div>
            <!-- /.box-header -->
            <div class="box-body pad-10">
                <div class="table-responsive">
                    <table class="table table-hover">
                        <thead>
                        <tr>
                            <th scope="col">#</th>
                            <th scope="col">{{ __('code') }}</th>
                            <th scope="col">教师</th>
                            <th scope="col">{{ __('Options') }}</th>
                        </tr>
                        </thead>
                        <tbody>
                        @if(isset($list))
                            @foreach($list as $idx => $item)
                                <tr>
                                    <th scope="row">{{ $idx + 1 }}</th>
                                    <td>{{ $item->tc_code }}</td>
                                    <td>{{ $item->name }}</td>
                                    <td>
                                        @if($currentAdmin->allow('classTeacher/add'))
                                            <a href="{{ route('admin.classTeacher.add', ['id' => $class->id, 'teacherCode'=>$item->tc_code]) }}" class="text-info">&nbsp;&nbsp;<i class="fa fa-edit"></i>设置为班主任</a>
                                        @endif
                                    </td>
                                </tr>
                            @endforeach
                        @endif
                        </tbody>
                    </table>
                </div>
                <div class="row">
                    <div class="clearfix"></div>
                    <div class="col-md-12 col-sm-12 col-xs-12 pull-right">
                        @if(isset($list))
                            {{ $list->links() }}
                        @endif
                    </div>
                </div>
            </div>

            <!-- /.box-body -->
            <div class="box-footer m-b-2">
                <div class="col-lg-4">
                    <a class="btn btn-default btn-sm" href="javascript:history.back(-1);">
                        <i class="fa fa-undo"></i> {{ __('Back') }}
                    </a>
                </div>
            </div>
            <!-- /.box-footer -->
        </div>
    </form>
@stop